package com.example.offer.no0024;

import com.example.offer.no0024.impl.SolutionImpl;

/**
 * 解答测试-反转链表
 *
 * @author yumuhui
 */
public class SolutionTest {

    public static void main(String[] a1rgs) {

        ListNode node = new ListNode(1);
        ListNode node_13 = new ListNode(3);
        ListNode node_132 = new ListNode(2);
        ListNode node_1324 = new ListNode(4);
        ListNode node_13245 = new ListNode(5);
        node_1324.next = node_13245;
        node_132.next = node_1324;
        node_13.next = node_132;
        node.next = node_13;

        System.out.println("入参: node: " + ListNode.toStr(node));

        Solution solution = new SolutionImpl();
        //        Solution solution = new RecurSolutionImpl();

        ListNode listNode = solution.reverseList(node);

        System.out.println(ListNode.toStr(listNode));
    }
}
